import request from '@/config/axios'

// 资讯分类 VO
export interface InfoClsVO {
  id: number // 资讯分类ID
  titleZhCn: string // 标题（中文）
  titleEnUs: string // 标题（英文）
}

// 资讯分类 API
export const InfoClsApi = {
  // 查询资讯分类分页
  getInfoClsPage: async (params: any) => {
    return await request.get({ url: `/business/info-cls/page`, params })
  },

  // 查询资讯分类详情
  getInfoCls: async (id: number) => {
    return await request.get({ url: `/business/info-cls/get?id=` + id })
  },

  // 查询所有资讯分类
  getInfoClsAll: async () => {
    return await request.get({ url: `/business/info-cls/all` })
  },

  // 新增资讯分类
  createInfoCls: async (data: InfoClsVO) => {
    return await request.post({ url: `/business/info-cls/create`, data })
  },

  // 修改资讯分类
  updateInfoCls: async (data: InfoClsVO) => {
    return await request.put({ url: `/business/info-cls/update`, data })
  },

  // 删除资讯分类
  deleteInfoCls: async (id: number) => {
    return await request.delete({ url: `/business/info-cls/delete?id=` + id })
  },

  // 导出资讯分类 Excel
  exportInfoCls: async (params) => {
    return await request.download({ url: `/business/info-cls/export-excel`, params })
  },
}
